<h1>Listing categories</h1>

<table>
  <tr>
    <th>Id</th>
    <th>Name</th>
    <th>Engname</th>
    <th>Info</th>
    <th>Svcid</th>
    <th>Status</th>
    <th>Regdttm</th>
  </tr>

<% for category in @categories %>
  <tr>
    <td><%=h category.id %></td>
    <td><%=h category.name %></td>
    <td><%=h category.engname %></td>
    <td><%=h category.info %></td>
    <td><%=h category.svcid %></td>
    <td><%=h category.status %></td>
    <td><%=h category.regdttm %></td>
    <td><%= link_to 'Show', category %></td>
    <td><%= link_to 'Edit', edit_category_path(category) %></td>
    <td><%= link_to 'Destroy', category, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<%= 
	mid = @page.to_i
	((mid-10)..(mid+10)).map{|i|
		tp = "%s";
	 	tp = "<b>%s</b>" if @page.to_i == i  
		link_to tp%i, {:action=>'index', :page=>i} 
	}.join(',') 
%>

<br />

<%= link_to 'New category', new_category_path %>
